package UIComponents
{
	import fl.events.ComponentEvent;
	
	import flash.display.DisplayObjectContainer;
	import flash.display.Sprite;
	import flash.text.TextField;
	
	public class TextTips extends Sprite
	{
		/**
		 * 按钮 
		 */		
		public var centerBtn:MyButton;
		/**
		 * 按钮文字 
		 */		
		public var btnTxt:TextField;
		
		public var titleTxt:TextField;
		public var contextTxt:TextField;
		
		public function TextTips()
		{
			init();
		}
		
		private function init():void
		{
			this.centerBtn=this.getChildByName("btn") as MyButton;
			this.centerBtn.mouseChildren=false;
			this.btnTxt=this.getChildByName("btn_txt") as TextField;
			this.btnTxt.selectable=false;
			this.btnTxt.mouseEnabled=false;
			this.titleTxt=this.getChildByName("txtTitle") as TextField;
			this.contextTxt=this.getChildByName("txtContext") as TextField;
			this.centerBtn.addEventListener(ComponentEvent.BUTTON_DOWN,clickFun);
		}
		
		public function setWinTxt(title:String="",context:String=""):void
		{
			this.titleTxt.text=title;
			this.contextTxt.text=context;
		}
		
		private function clickFun(ce:ComponentEvent):void
		{
			
			this.dispatchEvent(new PanelEvent(PanelEvent.CUSTOMCALLBACK,true));
		}
		
		public function controlCloseBtnVisable(visable:Boolean):void
		{
			(this.getChildByName("baseWin")as DisplayObjectContainer).getChildByName("windowCloseBtn").visible=visable;
		}
	}
}